package com.yaoyao.Trail_demo;

public class case1 {
    public static void main(String[] args) {
        double result = ticket_sale(200,12,"头等舱");
        System.out.println(result);

    }
    public static double ticket_sale(double price,int month,String types ){
        double sale =0;
        if(month >=5 && month <= 10){
            System.out.println("您当前购买机票时段为旺季");
            switch (types){
                case "头等舱":
                    sale = price * 0.9;
                    break;
                case "经济舱":
                    sale = price * 0.85;
                    break;
            }
        }
        if(month <= 4 || month >=11){
            System.out.println("您当前购买机票时段为淡季");
            switch (types){
                case "头等舱":
                    sale = price * 0.7;
                    break;
                case "经济舱":
                    sale = price * 0.65;
                    break;
            }
        }
        return sale;
    }
}
